package com.ylr.blog.framework.mapper;

import com.ylr.blog.framework.entity.BlogSpaceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-05-18 21:39:53
 * className: BlogSpaceMapper
 * version: 1.0
 * description:
 */
public interface BlogSpaceMapper extends BaseMapper<BlogSpaceEntity> {

    /**
     * 查询最大排序等级
     * @param parentId     父级空间主键
     * @param deleteStatus 删除状态
     * @return 排序等级值
     */
    Integer selectMaxSort(@Param("parentId") Long parentId, @Param("userId") Long userId, @Param("deleteStatus") Integer deleteStatus);

    /**
     * 查询子空间数量
     * @param id           主键
     * @param userId       用户主键
     * @param deleteStatus 删除状态
     * @return 子空间数量
     */
    Integer selectChildrenCount(@Param("id") Long id, @Param("userId") Long userId, @Param("deleteStatus") Integer deleteStatus);
}
